/**
 *  This file is part of AugeasWH.
 *
 *  AugeasWH. is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  AugeasWH. is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with AugeasWH.  If not, see <http://www.gnu.org/licenses/>.
 */

package cz.fit.vutbr.pis2012.augeaswh.persistence;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import static javax.persistence.CascadeType.ALL;


/**
 * The persistent class for the slots_stock_items database table.
 * 
 */
@Entity
@Table(name="slots_stock_items")
public class SlotsStockItem implements Serializable, AugeasWHEntity {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private SlotsStockItemPK id;

	private BigDecimal ammount;

	@Column(name="placing_date")
	private Timestamp placingDate;

	//bi-directional many-to-one association to Slot
    @ManyToOne(cascade = ALL)
	@JoinColumn(name = "slot_id", referencedColumnName = "id")
	@MapsId("slotId")
	private Slot slot;

	//bi-directional many-to-one association to StockItem
    @ManyToOne(cascade = ALL)
	@JoinColumn(name="stock_item_id")
	@MapsId("stockItemId")
	private StockItem stockItem;

    public SlotsStockItem() {
    }

	public SlotsStockItemPK getId() {
		return this.id;
	}

	public void setId(SlotsStockItemPK id) {
		this.id = id;
	}
	
	public BigDecimal getAmmount() {
		return this.ammount;
	}

	public void setAmmount(BigDecimal ammount) {
		this.ammount = ammount;
	}

	public Timestamp getPlacingDate() {
		return this.placingDate;
	}

	public void setPlacingDate(Timestamp placingDate) {
		this.placingDate = placingDate;
	}

	public Slot getSlot() {
		return this.slot;
	}

	public void setSlot(Slot slot) {
		this.slot = slot;
	}
	
	public StockItem getStockItem() {
		return this.stockItem;
	}

	public void setStockItem(StockItem stockItem) {
		this.stockItem = stockItem;
	}
	
}